package com.huyn.baseframework.dynamicload;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import java.lang.reflect.Constructor;

/**
 * Created by huyaonan on 16/6/24.
 */
public class BlurViewDecorator extends View {

    public BlurViewDecorator(Context context) {
        super(context);
    }

    public BlurViewDecorator(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public BlurViewDecorator(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public static BlurViewDecorator createBlurView(Context context, boolean autoBlur) throws Exception {
        Class<? extends BlurViewDecorator> clazz = context.getClassLoader().loadClass(autoBlur ? "com.aube.views.RealtimeBlurView" : "com.aube.views.BlurringView").asSubclass(BlurViewDecorator.class);
        Constructor<? extends BlurViewDecorator> constructor = clazz.getConstructor(Context.class);
        return constructor.newInstance(context);
    }

    public void setBlurredView(View view) {}
    public void setOverlayColor(int color) {}
    public void setBlurRadius(int radius) {}
    public void setDownsampleFactor(int factor) {}
    public void invalidateSelf() {}

}
